package imper.engine.util;

import imper.engine.entity.ArmyBoatType;
import imper.engine.entity.CivilUnitType;
import imper.engine.entity.Country;
import imper.engine.entity.FacilitiesType;
import imper.engine.entity.GameMap;
import imper.engine.entity.IndustryType;
import imper.engine.entity.LandType;
import imper.engine.entity.ResourcesType;
import imper.engine.entity.World;

import java.util.Map;

public class ParameterManager
{
  protected Map<Integer, IndustryType> _industryType = null;
  protected Map<Integer, ResourcesType> _resourcesType = null;
  protected Map<Integer, ArmyBoatType> _listArmyBoat = null;
  protected Map<Integer, CivilUnitType> _ListCivilUnitType = null;
  protected Map<Integer, FacilitiesType> _ListFacilitiesType = null;
  protected Map<Integer, LandType> _ListLandType = null;
  protected FacilitiesManager _FacilitiesManager = null;
  protected Country country = null;
  protected World _world = null;
  protected GameMap _map = null;
  protected MarketPlace _marketPlace = null;

  /** instance */
  private static ParameterManager _instance;

  /**
   * Constructor
   */
  protected ParameterManager()
  {
    _FacilitiesManager = new FacilitiesManager();
    _world = new World();
  }

  public static ParameterManager getInstance()
  {
    if (_instance == null)
    {
      _instance = new ParameterManager();
    }
    return _instance;
  }

  public IndustryType getIndustryType(Integer pIndex)
  {
    return _industryType.get(pIndex);
  }

  /**
   * @return the _industryType
   */
  public Map<Integer, IndustryType> getIndustryType()
  {
    return _industryType;
  }

  /**
   * @param type the _industryType to set
   */
  public void setIndustryType(Map<Integer, IndustryType> pType)
  {
    _industryType = pType;
  }

  public ResourcesType getResourcesType(Integer pIndex)
  {
    return _resourcesType.get(pIndex);
  }

  /**
   * @return the _industryType
   */
  public Map<Integer, ResourcesType> getResourcesType()
  {
    return _resourcesType;
  }

  /**
   * @param type the _industryType to set
   */
  public void setResourcesType(Map<Integer, ResourcesType> pType)
  {
    _resourcesType = pType;
  }

  public Country getMainCountry()
  {
    return country;
  }

  public void setMainCountry(Country pCountry)
  {
    this.country = pCountry;
  }

  public Map<Integer, ArmyBoatType> getListArmyBoat()
  {
    return _listArmyBoat;
  }

  public void setGameMap(GameMap pGameMap)
  {
    this._map = pGameMap;
  }

  public GameMap getGameMap()
  {
    return _map;
  }

  public void setListArmyBoat(Map<Integer, ArmyBoatType> plistArmyBoat)
  {
    this._listArmyBoat = plistArmyBoat;
  }

  public Map<Integer, CivilUnitType> getListCivilUnitType()
  {
    return _ListCivilUnitType;
  }

  public void setListCivilUnitType(Map<Integer, CivilUnitType> pListCivilUnitType)
  {
    this._ListCivilUnitType = pListCivilUnitType;
  }

  public Map<Integer, FacilitiesType> getListFacilitiesType()
  {
    return _ListFacilitiesType;
  }

  public void setListFacilitiesType(Map<Integer, FacilitiesType> pListFacilitiesType)
  {
    this._ListFacilitiesType = pListFacilitiesType;
  }

  public Map<Integer, LandType> getListLandType()
  {
    return _ListLandType;
  }

  public void setListLandType(Map<Integer, LandType> pListLandType)
  {
    this._ListLandType = pListLandType;
  }

  public FacilitiesManager getFacilitiesManager()
  {
    return _FacilitiesManager;
  }

  public void addCountry(Country pCountry)
  {
    _world.addCountry(pCountry);
  }

  public World getWorld()
  {
    return _world;
  }

  /**
   * @return the _marketPlace
   */
  public MarketPlace getMarketPlace()
  {
    return _marketPlace;
  }

  /**
   * @param _marketPlace the _marketPlace to set
   */
  public void setMarketPlace(MarketPlace pMarketPlace)
  {
    this._marketPlace = pMarketPlace;
  }

}
